using FlowCanvas;
using FlowCanvas.Nodes;
using UnityEngine;

namespace Yoozoo.Gameplay.Liberty.Nodes
{
    public class GetInputCameraData : PureFunctionNodeBase
    {
        public virtual Transform Invoke()
        {
            return BlueprintUtils.GetPlayerCamera().transform;
        }
        
        protected override void OnRegisterPorts(FlowNode node)
        {
            node.AddValueOutput<Vector3>("position", () =>
            {
                Transform t = Invoke();
                if (t!=null) return t.position;
                return Vector3.zero;
            });
            
            node.AddValueOutput<Vector3>("eulerAngles", () =>
            {
                Transform t = Invoke();
                if (t!=null) return t.eulerAngles;
                return Vector3.zero;
            });
            
            // node.AddValueOutput<Quaternion>("rotation", () =>
            // {
            //     Transform t = Invoke();
            //     if (t!=null) return t.rotation;
            //     return Quaternion.identity;
            // });
            // node.AddValueOutput<Vector3>("lossyScale", () =>
            // {
            //     Transform t = Invoke();
            //     if (t!=null) return t.lossyScale;
            //     return Vector3.zero;
            // });

        }
    }
}